<template>
    <div :class="{ outter: true, blackSty: videoType }" :style="videoType ? styleBlack : ''">
        <mHeader></mHeader>
        <div class="main-con">
            <div v-if="!videoType" class="article">
                <div class="all"
                    :style="{ overflow: drawer ? 'hidden' : '', height: drawer ? 'calc(100vh - 13.02083vw - 10px)' : '' }">
                    <div class="bookImg">
                        <img :src="info.thumb" alt="">
                    </div>
                    <div class="top" :style="{ borderColor: videoType ? '#fff' : '' }">
                        <p class="title" :style="videoType ? styleBlack2 : ''">
                            {{ info.title }}
                        </p>
                        <div class="author" :style="videoType ? styleBlack2 : ''">
                            <span v-if="info.author">作者 / {{ info.author }}</span>
                            <span v-if="info.owner">主委 / {{ info.owner }}</span>
                        </div>
                        <div class="other" v-if="info.helper.length != 0">
                            <span>执行主委/</span>
                            <div class="price" v-for="(item, index) in info.helper" :key="index">
                                <span>{{ item.user_nickname }}</span>
                            </div>
                        </div>
                        <div class="tron">
                            {{ info.intro }}
                        </div>
                    </div>
                    <div class="vhtml" ref="htmlContainers">
                        <!-- 渲染富文本 -->
                        <div class="richText" ref="htmlContainer" v-html="info.content" @mouseup="handleMouseUp"></div>
                        <!-- 自定义菜单 -->
                        <div v-if="showMenu" :style="menuStyle" class="custom-menu">
                            <button @click="getSelectedText('zc')">摘抄</button>
                            <button @click="getSelectedText('pl')">评论</button>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 右侧 -->
            <div v-if="!$store.getters.isMobile" class="tabList" :style="videoType ? styleBlack : ''">
                <div class="top" :style="{ borderColor: videoType ? '#fff' : '' }">
                    <p class="title" :style="videoType ? styleBlack2 : ''">
                        {{ info.title }}
                    </p>
                    <div class="author" :style="videoType ? styleBlack2 : ''">
                        <span v-if="info.author">作者 / {{ info.author }}</span>
                        <span v-if="info.owner">主委 / {{ info.owner }}</span>
                    </div>
                    <div class="other">
                        <div class="price" :style="videoType ? styleBlack2 : ''"
                            v-if="info.price != 0 && info.is_free == 2">
                            ￥<span class="num">{{ info.price }}</span>

                            <span style="color:#a39f9f ;">原价:￥</span>
                            <span class="num1">{{ info.old_price }}</span>
                            <span class="btn" v-if="info.price != 0 && info.is_pay == 2 && info.is_free == 2"
                                @click="openCol">购买</span>
                        </div>
                        <div class="price" :style="videoType ? styleBlack2 : ''" v-if="info.is_free == 1">
                            <span>免费专栏</span>
                        </div>
                        <div class="cod" :style="videoType ? styleBlack2 : ''">
                            <span @click="goFabu()">发文库</span>
                            <span @click="goMulu()" v-if="info.is_zw == 1">发目录</span>
                            <span v-if="info.is_visit == 1 && info.is_pass == 2" @click="dialogVisible4 = true"
                                style="color: red;">申请访问</span>
                            <span v-if="info.is_save == 2" @click="saveCol()">收藏</span>
                            <span v-if="info.is_save == 1" @click="saveCol()">取消收藏</span>
                            <span v-if="is_art && cinfo.is_like == 2" @click="likeArt()">❤点赞文库❤</span>
                            <span v-if="is_art && cinfo.is_like == 1" @click="likeArt()">❤取消点赞❤</span>
                        </div>
                    </div>

                </div>
                <div class="ptuan" v-if="info.groups">
                    <div class="priceT">
                        <span>团购价格：</span>
                        <div>
                            <span>￥</span>
                            <span>{{ info.groups.price }}</span>
                        </div>

                        <!-- <span class="btn" v-if="info.groups.price != 0" @click="buyNow">购买</span> -->
                        <div style="margin-left: 10px;">
                            <el-button type=" primary" @click="openGrp">拼团</el-button>

                        </div>

                    </div>
                    <div class="timeT">
                        <span>结束时间：{{ info.groups.end_time }}</span>
                        <span>成团人数：{{ info.groups.nums }}</span>
                    </div>
                </div>
                <div class="classify">
                    <div class="ltab">
                        <lTab ref="tab" :videoType="videoType" @changeTab="changeTab" :tabs="tabs" />
                        <img v-if="!cover" @click="cover = true" src="@/assets/img/search.svg" alt="">
                        <div v-else :class="{ search: true, cover: cover }" :style="videoType ? styleBlack : ''">
                            <input ref="searchs" @focus="getfocus" type="text" placeholder="" placeholder-class="pla"
                                v-model="keyword" @keyup.enter="goSearch">
                            <img src="@/assets/img/search.svg" alt="" @click="goSearch" @keyup.enter="goSearch">
                        </div>
                    </div>
                    <div class="classList">
                        <!-- 搜索 -->
                        <div class="sousuo" v-show="cover">
                            <div class="sstop">
                                <p style="color: #1068E7;">搜索结果</p>
                                <el-button type="danger" @click="closeSearch" round>关闭</el-button>
                            </div>


                            <div class="ptabs" style="padding-bottom: 0;" v-infinite-scroll="load7"
                                :infinite-scroll-distance="10" :infinite-scroll-immediate="false">
                                <div v-for="(item, index) in slist" :key="index">
                                    <!-- <div :class="{ line1: true, videoType: videoType }" @click="checkSearch(item)">
                                        {{ item.name }} 【{{ item.type == 'chp' ? '目录' : '文库' }}】</div> -->

                                    <div :class="{ line1: true, videoType: videoType }" v-html="item.search"
                                        @click="checkSearch(item)">
                                    </div>
                                </div>
                                <el-empty description="没有内容了" v-if="slist.length == 0"></el-empty>

                            </div>
                        </div>
                        <!-- //目录 -->
                        <div class="mulu" v-show="currentTab == 0 && !cover" v-infinite-scroll="load2"
                            :infinite-scroll-distance="10" :infinite-scroll-immediate="false">
                            <div v-for="item in chapter" :key="item.id">
                                <div :class="{ line1: true, active: item.id == cu_chpid ? true : false, videoType: videoType }"
                                    @click="ClickMulu(item.id, item.is_try, item.price, item.is_pay)">
                                    {{ item.title }}</div>
                                <span class="try" v-if="item.is_try" :style="{ color: videoType ? '#66CCFF' : '' }"
                                    @click="muluTry(item)">【试读】</span>
                            </div>
                            <div v-if="loading2" v-loading="loading2">
                            </div>
                            <el-empty description="没有内容了" v-if="chapter.length == 0"></el-empty>

                        </div>
                        <!-- 评论 -->
                        <div class="pinglun" v-show="currentTab == 1 && !cover">
                            <p :style="{ color: videoType ? '#fff' : '' }">全部评论 {{ ctotal }}</p>
                            <div class="ptabs" v-infinite-scroll="load3" :infinite-scroll-distance="10"
                                :infinite-scroll-immediate="false">
                                <lComment :videoType="videoType" v-for="(item, index) in comlist"
                                    :border="index != comlist.length - 1" :key="index" @goComm="goComm" @goOpen="goOpen"
                                    @goReport="openReport" :list="item" @reList="getComId" @reList1="getComId1" />

                                <el-empty description="期待你的评论哦~" v-if="comlist.length == 0"></el-empty>
                            </div>

                            <div class="pushPl" :style="{ backgroundColor: videoType ? '#000' : '' }">
                                <div class="callback" v-if="commuser.user_nickname">
                                    <div><span style="color:#1068E7 ;">回复：</span>{{ commuser.user_nickname }}</div>
                                    <span @click="commuser = ''">取消</span>
                                </div>
                                <el-input ref="comm" type="text" v-model="content">
                                </el-input>
                                <span class="append" @click="addComm()"> 评论</span>
                            </div>
                        </div>
                        <!-- 摘抄 -->
                        <div class="zhaichao" v-show="currentTab == 2 && !cover" v-infinite-scroll="load4"
                            :infinite-scroll-distance="10" :infinite-scroll-immediate="false">
                            <div>
                                <lExcerpt @onLike="onLike" :videoType="videoType" v-for="item in excerpt" :key="item.id"
                                    :list="item" @reList="getExpId" />
                                <el-empty description="没有内容了" v-if="excerpt.length == 0"></el-empty>

                            </div>
                        </div>
                        <!-- 文库 -->
                        <div class="wenku" v-show="currentTab == 3 && !cover" v-infinite-scroll="load5"
                            :infinite-scroll-distance="10" :infinite-scroll-immediate="false">
                            <div class="articku" v-for="(item, index) in article" :key="index">
                                <img class="type" :src="item.icon" alt="">
                                <div :class="{ line1: true, videoType: videoType }" @click="goPage('/columnRead')"
                                    v-if="item.op > 3">
                                    {{ item.title }}</div>
                                <div v-else @click="goArticle(item.is_pay, '/articleRead', item.id)"
                                    :class="{ line1: true, videoType: videoType }">
                                    {{ item.title }}</div>


                            </div>
                            <el-empty description="没有内容了" v-if="article.length == 0"></el-empty>

                        </div>
                        <!-- 推荐 -->
                        <div class="tuijian" v-show="currentTab == 4" v-infinite-scroll="load6"
                            :infinite-scroll-distance="10" :infinite-scroll-immediate="false">
                            <div class="list_box" v-for="(item, index) in recolist" :key="index"
                                @click="goZL('/columnRead', item.id)">
                                <img :src="item.thumb" alt="">
                                <div class="list_t">
                                    <span :style="{ color: videoType ? '#fff' : '' }" class="line2">【{{ item.title
                                    }}】 {{ item.intro
                                        }}</span>
                                    <div>
                                        <span class="line1">{{ item.user_nickname }}</span>
                                        <div>
                                            <img src="@/assets/img/eye.png" alt="">
                                            <span>{{ item.views }}</span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <el-empty description="没有内容了" v-if="recolist.length == 0"></el-empty>

                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div v-if="$store.getters.isMobile" class="mul" @click="drawer = true">
            <img src="@/assets/img/mul.png" alt="">
            <span>目录</span>
        </div>
        <el-drawer v-if="$store.getters.isMobile" size="90%" :visible.sync="drawer" direction="rtl">
            <div class="tabList" :style="videoType ? styleBlack : ''">
                <div class="top" :style="{ borderColor: videoType ? '#fff' : '' }">
                    <p class="title" :style="videoType ? styleBlack2 : ''">
                        {{ info.title }}
                    </p>
                    <div class="author" :style="videoType ? styleBlack2 : ''">
                        <span v-if="info.author">作者 / {{ info.author }}</span>
                        <span v-if="info.owner">主委 / {{ info.owner }}</span>
                    </div>
                    <div class="other">
                        <div class="price" :style="videoType ? styleBlack2 : ''"
                            v-if="info.price != 0 && info.is_free == 2">
                            ￥<span class="num">{{ info.price }}</span>

                            <span style="color:#a39f9f ;">原价:￥</span>
                            <span class="num1">{{ info.old_price }}</span>
                            <span class="btn" v-if="info.price != 0 && info.is_pay == 2 && info.is_free == 2"
                                @click="openCol">购买</span>
                        </div>
                        <div class="price" :style="videoType ? styleBlack2 : ''" v-if="info.is_free == 1">
                            <span>免费专栏</span>
                        </div>
                        <div class="cod" :style="videoType ? styleBlack2 : ''">
                            <span v-if="info.is_visit == 1 && info.is_pass == 2" @click="dialogVisible4 = true"
                                style="color: red;">申请访问</span>
                            <span v-if="info.is_save == 2" @click="saveCol()">收藏</span>
                            <span v-if="info.is_save == 1" @click="saveCol()">取消收藏</span>
                            <span v-if="is_art && cinfo.is_like == 2" @click="likeArt()">❤点赞文库❤</span>
                            <span v-if="is_art && cinfo.is_like == 1" @click="likeArt()">❤取消点赞❤</span>
                        </div>
                    </div>

                </div>
                <div class="ptuan" v-if="info.groups">
                    <div class="priceT">
                        <span>团购价格：</span>
                        <div>
                            <span>￥</span>
                            <span>{{ info.groups.price }}</span>
                        </div>

                        <!-- <span class="btn" v-if="info.groups.price != 0" @click="buyNow">购买</span> -->
                        <div style="margin-left: 10px;">
                            <el-button type=" primary" @click="openGrp">拼团</el-button>

                        </div>

                    </div>
                    <div class="timeT">
                        <span>结束时间：{{ info.groups.end_time }}</span>
                        <span>成团人数：{{ info.groups.nums }}</span>
                    </div>
                </div>
                <div class="classify">
                    <div class="ltab">
                        <lTab ref="tab" :videoType="videoType" @changeTab="changeTab" :tabs="tabs" />
                        <img v-if="!cover" @click="cover = true" src="@/assets/img/search.svg" alt="">
                        <div v-else :class="{ search: true, cover: cover }" :style="videoType ? styleBlack : ''">
                            <input ref="searchs" @focus="getfocus" type="text" placeholder="" placeholder-class="pla"
                                v-model="keyword" @keyup.enter="goSearch">
                            <img src="@/assets/img/search.svg" alt="" @click="goSearch" @keyup.enter="goSearch">
                        </div>
                    </div>
                    <div class="classList">
                        <!-- 搜索 -->
                        <div class="sousuo" v-show="cover">
                            <div class="sstop">
                                <p style="color: #1068E7;">搜索结果</p>
                                <el-button type="danger" @click="closeSearch" round>关闭</el-button>
                            </div>


                            <div class="ptabs" style="padding-bottom: 0;" v-infinite-scroll="load7"
                                :infinite-scroll-distance="10" :infinite-scroll-immediate="true">
                                <div v-for="(item, index) in slist" :key="index">
                                    <!-- <div :class="{ line1: true, videoType: videoType }" @click="checkSearch(item)">
                                        {{ item.name }} 【{{ item.type == 'chp' ? '目录' : '文库' }}】</div> -->

                                    <div :class="{ line1: true, videoType: videoType }" v-html="item.search"
                                        @click="checkSearch(item)">
                                    </div>
                                </div>
                                <el-empty description="没有内容了" v-if="slist.length == 0"></el-empty>

                            </div>
                        </div>
                        <!-- //目录 -->
                        <div class="mulu" v-if="currentTab == 0 && !cover" v-infinite-scroll="load2"
                            :infinite-scroll-distance="10" :infinite-scroll-immediate="true">
                            <div v-for="item in chapter" :key="item.id">
                                <div :class="{ line1: true, active: item.id == cu_chpid ? true : false, videoType: videoType }"
                                    @click="ClickMulu(item.id, item.is_try, item.price, item.is_pay)">
                                    {{ item.title }}</div>
                                <span class="try" v-if="item.is_try" :style="{ color: videoType ? '#66CCFF' : '' }"
                                    @click="muluTry(item)">【试读】</span>
                            </div>
                            <div v-if="loading2" v-loading="loading2">
                            </div>
                            <el-empty description="没有内容了" v-if="chapter.length == 0"></el-empty>

                        </div>
                        <!-- 评论 -->
                        <div class="pinglun" v-if="currentTab == 1 && !cover">
                            <p :style="{ color: videoType ? '#fff' : '' }">全部评论 {{ ctotal }}</p>
                            <div class="ptabs" v-infinite-scroll="load3" :infinite-scroll-distance="10"
                                :infinite-scroll-immediate="true">
                                <lComment :videoType="videoType" v-for="(item, index) in comlist"
                                    :border="index != comlist.length - 1" :key="index" @goComm="goComm" @goOpen="goOpen"
                                    @goReport="openReport" :list="item" @reList="getComId" @reList1="getComId1" />

                                <el-empty description="期待你的评论哦~" v-if="comlist.length == 0"></el-empty>
                            </div>

                            <div class="pushPl" :style="{ backgroundColor: videoType ? '#000' : '' }">
                                <div class="callback" v-if="commuser.user_nickname">
                                    <div><span style="color:#1068E7 ;">回复：</span>{{ commuser.user_nickname }}</div>
                                    <span @click="commuser = ''">取消</span>
                                </div>
                                <el-input ref="comm" type="text" v-model="content">
                                </el-input>
                                <span class="append" @click="addComm()"> 评论</span>
                            </div>
                        </div>
                        <!-- 摘抄 -->
                        <div class="zhaichao" v-if="currentTab == 2 && !cover" v-infinite-scroll="load4"
                            :infinite-scroll-distance="10" :infinite-scroll-immediate="true">
                            <div>
                                <lExcerpt @onLike="onLike" :videoType="videoType" v-for="item in excerpt" :key="item.id"
                                    :list="item" @reList="getExpId" />
                                <el-empty description="没有内容了" v-if="excerpt.length == 0"></el-empty>

                            </div>
                        </div>
                        <!-- 文库 -->
                        <div class="wenku" v-if="currentTab == 3 && !cover" v-infinite-scroll="load5"
                            :infinite-scroll-distance="10" :infinite-scroll-immediate="true">
                            <div class="articku" v-for="(item, index) in article" :key="index">
                                <img class="type" :src="item.icon" alt="">
                                <div :class="{ line1: true, videoType: videoType }" @click="goPage('/columnRead')"
                                    v-if="item.op > 3">
                                    {{ item.title }}</div>
                                <div v-else @click="goArticle(item.is_pay, '/articleRead', item.id)"
                                    :class="{ line1: true, videoType: videoType }">
                                    {{ item.title }}</div>


                            </div>
                            <el-empty description="没有内容了" v-if="article.length == 0"></el-empty>

                        </div>
                        <!-- 推荐 -->
                        <div class="tuijian" v-if="currentTab == 4" v-infinite-scroll="load6"
                            :infinite-scroll-distance="10" :infinite-scroll-immediate="true">
                            <div class="list_box" v-for="(item, index) in recolist" :key="index"
                                @click="goZL('/columnRead', item.id)">
                                <img :src="item.thumb" alt="">
                                <div class="list_t">
                                    <span :style="{ color: videoType ? '#fff' : '' }" class="line2">【{{ item.title
                                    }}】 {{ item.intro
                                        }}</span>
                                    <div>
                                        <span class="line1">{{ item.user_nickname }}</span>
                                        <div>
                                            <img src="@/assets/img/eye.png" alt="">
                                            <span>{{ item.views }}</span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <el-empty description="没有内容了" v-if="recolist.length == 0"></el-empty>

                        </div>
                    </div>
                </div>
            </div>
        </el-drawer>
        <!-- 弹窗 -->
        <el-dialog :close-on-click-modal="false" :visible.sync="dialogVisible"
            :width="$store.getters.isMobile ? '90%' : '800px'">
            <span slot="title" class="dialog-footer">
                选取段落：{{ tip }}
            </span>
            <div class="pop">
                <el-input :autosize="{ minRows: 2, maxRows: 4 }" :readOnly="tip != '摘抄'" style="font-size: 18px;"
                    type="textarea" v-model="selectedText"></el-input>
                <el-form style="margin-top: 60px;" inline ref="form" :model="form" v-if="tip == '摘抄'">
                    <el-form-item label="出处:">
                        <el-input v-model="form.source" placeholder="请输入出处"></el-input>
                    </el-form-item>
                    <el-form-item label="作者:">
                        <el-input v-model="form.author" placeholder="请输入作者"></el-input>
                    </el-form-item>
                </el-form>
                <el-form v-else inline ref="form">
                    <el-form-item label="评论内容:">
                    </el-form-item>
                    <el-input placeholder="请输入评论内容..." style="font-size: 18px;" type="textarea" v-model="pl"></el-input>
                </el-form>
                <div class="comment" v-if="tip != '摘抄'">
                    <p>评论列表：</p>
                    <div class="listCom" v-infinite-scroll="load" :infinite-scroll-distance="10"
                        :infinite-scroll-immediate="false">
                        <div v-for="(item, index) in comList" :key="item.id">
                            <lComment :set="false" :list="item" :border="index != comList.length - 1" />
                        </div>
                        <div v-if="loading" v-loading="loading">
                        </div>
                        <el-empty description="没有内容了" v-if="comList.length == 0"></el-empty>
                    </div>
                </div>
            </div>
            <span slot="footer" class="dialog-footer" v-if="tip != '摘抄'">
                <el-button size="medium" @click="closeDia">取 消</el-button>
                <el-button type="primary" @click="addPara">确 定</el-button>
            </span>
            <span slot="footer" class="dialog-footer" v-if="tip == '摘抄'">
                <el-button size="medium" @click="closeDia">取 消</el-button>
                <el-button type="primary" @click="addExcerpt">确 定</el-button>
            </span>
        </el-dialog>

        <el-dialog :visible.sync="dialogVisible4" :width="$store.getters.isMobile ? '90%' : '700px'">
            <span slot="title" class="dialog-header">
                <i style="color:#d41f19;margin-right: 12px;" class="el-icon-s-order"></i>申请访问
            </span>
            <el-form ref="form" label-width="6.25vw">

                <div class="select">
                    <el-form-item label="申请留言:" required>
                        <el-input type="textarea" v-model="remark" placeholder="请输入留言内容"></el-input>
                    </el-form-item>
                </div>
            </el-form>
            <span slot="footer" class="dialog-footer">
                <el-button @click="dialogVisible4 = false">取 消</el-button>
                <el-button type="primary" @click="applyNow">确 定</el-button>
            </span>
        </el-dialog>

        <!-- 评论举报弹窗 -->
        <el-dialog :visible.sync="dialogVisible5" :width="$store.getters.isMobile ? '90%' : '700px'" @close="closeDiajb">
            <span slot="title" class="dialog-header">
                <i style="color:#d41f19;margin-right: 12px;" class="el-icon-warning"></i>举报
            </span>
            <el-form ref="form" label-width="6.25vw">
                <el-form-item label="举报对象:">
                    <el-input :value="reUname" disabled></el-input>
                </el-form-item>

                <div class="select">
                    <el-form-item label="举报类型:" required>
                        <el-select filterable v-model="form3.reason" placeholder="请选择类型">
                            <el-option v-for="(item, index) in jbly" :label="item" :value="item"
                                :key="index"></el-option>
                        </el-select>
                    </el-form-item>
                </div>
                <div class="textarea">
                    <el-form-item label="举报说明:" require>
                        <el-input type="textarea" v-model="form3.remark" placeholder="请输入举报说明"></el-input>
                    </el-form-item>
                </div>
            </el-form>
            <span slot="footer" class="dialog-footer">
                <el-button @click="dialogVisible5 = false">取 消</el-button>
                <el-button type="primary" @click="onsubmit3">确 定</el-button>
            </span>
        </el-dialog>
        <ShareDia ref="shareDia" :info="shareInfo"></ShareDia>
        <buyDia ref="buyDia" :info="ainfo" @onstop="clearTimer"></buyDia>


        <el-dialog top="40vh" title="提示" :visible.sync="showCol" :width="$store.getters.isMobile ? '90%' : '350px'">
            <span slot="title" class="dialog-header" style="font-size: 18px;">
                <i style="color:#d41f19;margin-right: 12px;" class="el-icon-money"></i>专栏支付方式
            </span>
            <span class="dialog-footer2">
                <el-button type="success" @click="buyNow(1)">微信支付</el-button>
                <el-button type="primary" @click="buyNow(2)">余额支付</el-button>
            </span>
        </el-dialog>



        <el-dialog top="40vh" title="提示" :visible.sync="showChp" :width="$store.getters.isMobile ? '90%' : '350px'">
            <span slot="title" class="dialog-header" style="font-size: 18px;">
                <i style="color:#d41f19;margin-right: 12px;" class="el-icon-money"></i>章节支付方式
            </span>
            <span class="dialog-footer2">
                <el-button type="success" @click="buyChp(1)">微信支付</el-button>
                <el-button type="primary" @click="buyChp(2)">余额支付</el-button>
            </span>
        </el-dialog>


        <el-dialog :visible.sync="showPay" :width="$store.getters.isMobile ? '90%' : '400px'" @close="clearTimer">
            <span slot="title" class="dialog-header">
                <i style="color:#1068E7;margin-right: 5px;" class="iconfont">&#xe638;</i>微信扫码支付
            </span>
            <div style="display: flex;align-items: center;justify-content: center;">
                <img style="max-width: 300px;max-height: 300px;" :src="pay_img" alt="">
            </div>
        </el-dialog>

        <el-dialog top="40vh" title="提示" :visible.sync="showGrp" :width="$store.getters.isMobile ? '90%' : '350px'">
            <span slot="title" class="dialog-header" style="font-size: 18px;">
                <i style="color:#d41f19;margin-right: 12px;" class="el-icon-money"></i>拼团支付方式
            </span>
            <span class="dialog-footer2">
                <el-button type="success" @click="buyGrp(1)">微信支付</el-button>
                <el-button type="primary" @click="buyGrp(2)">余额支付</el-button>
            </span>
        </el-dialog>



        <el-dialog top="40vh" title="提示" :visible.sync="showArt" :width="$store.getters.isMobile ? '90%' : '350px'">
            <span slot="title" class="dialog-header" style="font-size: 18px;">
                <i style="color:#d41f19;margin-right: 12px;" class="el-icon-money"></i>文库支付方式
            </span>
            <span class="dialog-footer2">
                <el-button type="success" @click="buyNow1(1)">微信支付</el-button>
                <el-button type="primary" @click="buyNow1(2)">余额支付</el-button>
            </span>
        </el-dialog>


    </div>
</template>

<script>
import { baseUrl } from '@/apis/index'
import 'swiper/css/swiper.css';
import text from "@/assets/img/text.png"
import lExcerpt from "./l-excerpt/index.vue"
import lComment from "./l-comment/index.vue"
import lTab from "@/components/lTab.vue"
import ShareDia from "@/components/shareDia.vue"
import buyDia from "@/components/buyDia.vue"
export default {
    components: {
        lComment,
        lTab,
        lExcerpt,
        ShareDia,
        buyDia
    },
    data() {
        return {
            showArt: false,
            showGrp: false,
            showPay: false,
            showCol: false,
            showChp: false,
            drawer: false,
            cu_chpid: '', //当前目录id
            content: '',
            cinfo: {}, // 当前目录详情
            jbly: [],
            giftnum: 1,
            swiperOptions: {
                slidesPerView: 5,
                spaceBetween: 20,
                navigation: {
                    nextEl: '.swiper-button-next',
                    prevEl: '.swiper-button-prev',
                },
            },
            slides: [],
            giftId: '',
            loading: false,

            aloading: false,
            acomlist: [],
            atotalPage: 1,
            apageNum: 1,// 评论列表
            atotal: 0,

            loading2: false,
            chapter: [],
            totalPage2: 1,
            pageNum2: 1,// 目录列表

            loading3: false,
            comlist: [],
            totalPage3: 1,
            pageNum3: 1,// 评论列表
            ctotal: 0,

            loading4: false,
            excerpt: [],
            totalPage4: 1,
            pageNum4: 1,// 摘抄列表

            loading5: false,
            article: [],
            totalPage5: 1,
            pageNum5: 1,// 文库列表

            loading6: false,
            recolist: [],
            totalPage6: 1,
            pageNum6: 1,// 推荐列表

            focus: false,
            richText: ``,
            showMenu: false, // 是否显示菜单
            menuStyle: { top: '0', left: '0' }, // 菜单位置
            selectedRange: null,// 存储选中的范围
            selectedText: '',
            dialogVisible: false,
            dialogVisible2: false,
            dialogVisible3: false,
            dialogVisible4: false,  // 申请访问 备注弹窗
            dialogVisible5: false,  // 举报评论弹窗
            tip: '评论',
            form: {
                source: '',
                author: ''
            },
            form2: {
                reason: '',
                remark: ''
            },
            form3: {
                reason: '',
                remark: ''
            },
            pl: '',
            remark: '',
            list: [],
            totalPage: 1,
            pageNum: 1,
            comList: [],
            tabs: ['目录', '评论', '摘抄', '文库', '推荐'],
            currentTab: 0,
            muluList: [],
            comment: '',
            video: '',
            commuser: {},
            typeImg: {
                text
            },
            videoType: false,
            videoSrc: '',
            styleBlack: {
                background: '#000',
            },
            styleBlack2: {
                color: '#fff'
            },
            cover: false,
            info: {},
            reUname: '', // 评论举报对象
            userInfo: {},
            is_art: false,
            ainfo: {
                price: 0
            },
            col_id: 0,
            slist: [], // 搜索结果
            sloading: false,
            stotalPage: 1,
            spageNum: 1,// 推荐列表
            keyword: '',
            is_bm: '',
            bm_op: '',
            bm_col: '',
            timer: null,
            timer1: null,
            timer2: null,
            timer3: null,
            acontent: '',
            bm_uid: '',
            art_id: '',
            pay_img: '',
            shareInfo: {},

        };
    },
    computed: {
        // 获取 Swiper 实例
        swiper() {
            return this.$refs.mySwiper.$swiper;
        },
        aid() {
            return this.$route.query.aid;
        },
    },
    watch: {
        cover(newVal) {
            if (newVal) {
                this.$nextTick(() => {
                    this.$refs.searchs.focus();
                });
            }
        },
        aid(n) {
            this.getArticleInfo(this.aid)
        }
    },
    created() {
        window.scrollTo({ top: 0 })
    },
    mounted() {
        // 监听 selectionchange 事件
        document.addEventListener('selectionchange', this.handleSelectionChange);
        this.id = this.$route.query.id
        let aid = this.$route.query.aid // 文库id
        let col_id = this.$route.query.col_id  // 是否为源发
        this.getGiftList()
        this.getOption()

        if (this.id) {
            this.getInfo()
            this.getChapter()
        }


        if (aid) {
            if (col_id) {
                this.col_id = col_id
            }
            this.getArticleInfo(aid)
            this.getArtComment() //文库评论列表
        }

        // 优品帮卖
        let bm_op = this.$route.query.bm_op
        let old_col = this.$route.query.old_col
        let bm_uid = this.$route.query.uid
        if (bm_op) {
            this.is_bm = 2
            this.bm_op = bm_op
            this.bm_col = old_col
        }

        if (bm_uid) {
            this.bm_uid = bm_uid
        }


    },

    methods: {

        // 打开分享弹窗并记录
        openShare() {
            let params = {
                id: this.info.id,
                op: this.is_art ? 2 : 1
            }
            this.$api.addShare(params).then(res => {
                if (res.data.code == 1) {
                    this.openNow()

                    this.getInfo()
                }
            })
        },

        openNow(title = '') {
            const fullUrl = window.location.href;
            this.shareInfo = {
                title: title ? title : this.info.title,
                link: fullUrl,
                img: baseUrl + 'home/base/qrcod?url=' + fullUrl
            };
            this.$refs.shareDia.open()

        },



        buyNow1(op) {
            let params = {
                id: this.art_id,
                pay_op: op
            }
            this.$api.payArt(params).then(res => {
                if (res.data.code == 1) {
                    this.showArt = false
                    if (op == 1) {
                        this.showPay = true
                        this.pay_img = baseUrl + 'home/base/qrcod?url=' + res.data.data.code_url;
                        this.query_art(res.data.data.id)
                    } else {

                        this.$message({
                            message: '购买成功',
                            type: 'success'
                        })
                        this.article = []
                        this.pageNum5 = 1
                        this.getArticle()
                    }
                }
            })
        },

        query_art(id) {
            // 3秒定时执行
            this.timer = setInterval(() => {
                let params = {
                    id
                }

                this.$api.queryArticle(params).then(res => {
                    if (res.data.code == 1) {
                        this.showPay = false
                        this.$message({
                            message: '购买文库成功',
                            type: 'success'
                        })
                        this.clearTimer()
                        this.article = []
                        this.pageNum5 = 1
                        this.getArticle()
                    }
                })
            }, 3000)
        },

        checkSearch(item) {
            // this.goPage('/columnRead')
            let type = item.type
            if (type == 'chp') {
                // 目录
                this.goChapter('/columnRead', item.id, this.keyword)

                // this.goPage(item.is_pay, '/coluRead', item.id, this.keyword)
            } else {
                // 文库
                this.goArticle(item.is_pay, '/articleRead', item.id, this.keyword)

            }
        },


        goArticle(is_pay, url, aid, keyword = '') {
            if (is_pay == 2) {
                this.art_id = aid
                this.showArt = true
                return
            }

            this.$router.push({
                path: url,
                query: {
                    aid,
                    keyword
                }
            })
        },

        goChapter(url, cid, keyword) {

            this.$router.push({
                path: url,
                query: {
                    id: this.id,
                    cid,
                    keyword
                }
            })
        },
        closeSearch() {
            this.cover = false
            this.keyword = ''
            this.slist = []
        },
        goSearch() {

            this.slist = []
            this.spageNum = 1
            this.searchCol()
        },

        searchCol() {
            this.sloading = true
            let params = {
                page: this.spageNum,
                keyword: this.keyword,
                id: this.id
            }

            this.$api.searchCol(params).then(res => {
                let response = res.data.data
                if (res.data.code == 1) {
                    this.stotalPage = response.last_page
                    this.slist = this.slist.concat(response.data);
                    console.log(this.slist)
                    this.sloading = false
                }

            })
        },


        goChongZ(url) {
            this.$router.push({
                path: url
            })
        },
        goPage(url, cid) {

            this.$router.push({
                path: url,
                query: {
                    id: this.id,
                    cid
                }
            })
        },

        // 下载方法 文库
        download(is_pay, filePath, fileName, id) {
            if (is_pay == 2) {
                this.art_id = id
                this.showArt = true
                return
            }

            let url = baseUrl + 'home/base/download?filePath=' + filePath + '&fileName=' + fileName + '&id=' + id
            window.open(url);
        },
        goZL(url, id) {
            this.is_art = false

            // 点击推荐专栏的时候 记录上一页的专栏id
            this.$router.push({
                path: url,
                query: {
                    id,
                    old_col: this.id,
                    bm_op: 1
                }
            })
            this.id = id

            this.getInfo()
            this.$refs.tab.changeTab(0)

        },
        openGift() {
            this.getUinfo()
        },
        getUinfo() {
            this.$api.getUserInfo().then(res => {
                if (res.data.code == 1) {
                    this.userInfo = res.data.data
                    this.dialogVisible3 = true
                }
            })
        },
        goFabu() {
            this.$router.push({
                path: '/columnPost/library',
                query: {
                    id: this.id
                }
            })
        },
        goMulu() {
            this.$router.push({
                path: '/columnPost/List',
                query: {
                    cid: this.id
                }
            })
        },
        // 段落评论
        addPara() {
            let params = {
                id: this.cu_chpid,
                chose: this.selectedText,
                content: this.pl
            }
            this.$api.paraCol(params).then(res => {
                if (res.data.code == 1) {
                    this.$message({
                        message: res.data.msg,
                        type: 'success'
                    })
                    this.dialogVisible = false
                    this.pl = ''
                    let is_pay = this.info.is_pay
                    if (is_pay == 1) {
                        this.getChapterInfo(this.chapter[0].id)
                    }

                }
            })
        },

        // 申请访问专栏
        applyNow() {
            let params = {
                id: this.id,
                op: 1,
                remark: this.remark
            }
            this.$api.applyNow(params).then(res => {
                if (res.data.code == 1) {
                    this.$message({
                        message: res.data.msg,
                        type: 'success'
                    })
                    this.dialogVisible4 = false
                    this.remark = ''

                }
            })
        },


        // 提交摘抄
        addExcerpt() {
            let params = {
                id: this.id,
                content: this.selectedText,
                source: this.form.source,
                author: this.form.author
            }
            console.log(params)
            this.$api.addExpcerpt(params).then(res => {
                if (res.data.code == 1) {
                    this.$message({
                        message: res.data.msg,
                        type: 'success'
                    })
                    this.dialogVisible = false
                    this.form.author = this.info.author
                    this.form.source = this.info.title

                }
            })
        },


        // 评论专栏
        addComm() {
            let reply_id = this.commuser.id ? this.commuser.id : 0
            let params = {
                id: this.id,
                content: this.content,
                op: 1,
                reply_id,
            }
            this.$api.addCommet(params).then(res => {
                if (res.data.code == 1) {
                    this.$message({
                        message: '感谢你的评论',
                        type: 'success'
                    })

                    this.pageNum3 = 1
                    this.content = ''
                    this.comlist = []
                    this.getComment()
                }
            })
        },

        // 评论文库
        addArtComm() {
            let params = {
                id: this.aid,
                content: this.acontent,
                op: 2
            }
            this.$api.addCommet(params).then(res => {
                if (res.data.code == 1) {
                    this.$message({
                        message: '感谢你的评论',
                        type: 'success'
                    })
                    this.apageNum = 1
                    this.acontent = ''
                    this.getArtComment()
                }
            })
        },

        // 举报专栏章节
        addReport() {
            this.dialogVisible2 = true
        },

        // 点赞专栏
        likeCol() {
            let params = {
                id: this.id
            }
            this.$api.likeCol(params).then(res => {
                console.log(res)
                if (res.data.code == 1) {
                    this.info.is_like = res.data.data
                    this.getInfo()
                }
            })
        },

        // 收藏专栏
        saveCol() {
            let params = {
                id: this.id
            }
            this.$api.saveCol(params).then(res => {
                console.log(res)
                if (res.data.code == 1) {
                    this.info.is_save = res.data.data
                    this.getInfo()
                }
            })
        },

        // 点赞文库
        likeArt() {
            let params = {
                id: this.aid
            }
            this.$api.likeArt(params).then(res => {
                if (res.data.code == 1) {
                    this.cinfo.is_like = res.data.data
                    // this.getArticleInfo(aid)
                }
            })
        },

        // 获取举报配置选项
        getOption() {
            let params = {
                type: 'jbly'
            }
            this.$api.getOptions(params).then(res => {
                if (res.data.code == 1) {
                    this.jbly = res.data.data.jbly

                }
            })
        },

        // 礼物打赏列表
        getGiftList() {
            this.$api.getGift().then(res => {
                this.slides = res.data.data
                this.giftId = res.data.data[0] ? res.data.data[0].id : ''
            })
        },

        getGift(id) {
            this.giftId = id
        },

        sendGift() {
            let params = {
                op: 1,
                id: this.id,
                nums: this.giftnum,
                gift: this.giftId
            }
            this.$api.sendGift(params).then(res => {
                if (res.data.code == 1) {
                    this.$message({
                        message: res.data.msg,
                        type: 'success'
                    })
                    this.giftnum = 1
                    this.ds_num = 1
                    this.dialogVisible3 = false
                    this.getInfo()
                }

            })
        },

        // 目录
        getChapter() {
            this.loading2 = true
            let params = {
                page: this.pageNum2,
                id: this.id
            }
            this.$api.getColchapter(params).then(res => {
                if (res.data.code == 1) {
                    this.totalPage2 = res.data.data.last_page
                    this.chapter = this.chapter.concat(res.data.data.data);
                    this.loading2 = false
                    let is_pay = 1

                    if (this.info.is_free == 2) {
                        let is_pay = this.info.is_pay
                    }


                    if (res.data.data.data.length != 0 && !this.is_art && is_pay == 1) {
                        // this.cu_chpid = this.chapter[0].id
                        this.getChapterInfo(this.chapter[0].id, 2)
                    }
                }

            })
        },

        // 专栏评论列表
        getComment() {
            this.loading3 = true
            let params = {
                page: this.pageNum3,
                id: this.id,
                op: 1,
                is_reply: 0
            }
            this.$api.getcomment(params).then(res => {
                this.totalPage3 = res.data.data.last_page
                this.comlist = this.comlist.concat(res.data.data.data);
                this.loading3 = false
                this.ctotal = res.data.data.total
            })
        },



        // 文库评论列表
        getArtComment() {
            this.aloading = true
            let params = {
                page: this.apageNum,
                id: this.aid,
                op: 2
            }
            this.$api.getcomment(params).then(res => {
                this.atotalPage3 = res.data.data.last_page
                this.acomlist = this.acomlist.concat(res.data.data.data);
                this.aloading3 = false
                this.atotal = res.data.data.total
            })
        },

        // 摘抄
        getExcerpt() {
            this.loading4 = true
            let params = {
                page: this.pageNum4,
                id: this.id
            }
            this.$api.getColexcerpt(params).then(res => {
                this.totalPage4 = res.data.data.last_page
                this.excerpt = this.excerpt.concat(res.data.data.data);
                this.loading4 = false
            })
        },

        // 文库
        getArticle() {
            this.loading5 = true
            let params = {
                page: this.pageNum5,
                id: this.id
            }
            this.$api.getColarticle(params).then(res => {
                this.totalPage5 = res.data.data.last_page
                this.article = this.article.concat(res.data.data.data);
                this.loading5 = false
            })
        },


        // 推荐
        getReco() {
            this.loading6 = true
            let params = {
                page: this.pageNum6,
                id: this.id
            }
            this.$api.getColReco(params).then(res => {
                this.totalPage6 = res.data.data.last_page
                this.recolist = this.recolist.concat(res.data.data.data);
                this.loading6 = false
            })
        },


        // 获取专栏详情
        addShare() {
            let params = {
                id: this.id
            }
            this.$api.getColInfo(params).then(res => {
                if (res.data.code == 1) {
                    this.info = res.data.data

                    let path = 'http://ztk.yibi.com.cn' + this.mypath
                    this.shareInfo = {
                        title: this.info.title,
                        link: path,
                        img: baseUrl + 'home/base/qrcod?url=' + path
                    };
                }
            })
        },



        // 获取专栏详情
        getInfo() {
            let params = {
                id: this.id
            }
            this.$api.getColInfo(params).then(res => {
                if (res.data.code == 1) {
                    this.info = res.data.data
                    let is_pay = this.info.is_pay

                    // 摘抄默认 获取出处和作者
                    this.form.source = this.info.title
                    this.form.author = this.info.author
                    // if (is_pay == 2) {
                    //     this.$message({
                    //         message: '本专栏为收费专栏，请付费购买后再查看。你也可以单独购买本章节内容。',
                    //         type: 'warning'
                    //     })
                    // }
                }
            })
        },

        // 获取目录详情
        getChapterInfo(id, gopay = 1) {
            let params = {
                id
            }
            this.$api.getChapterInfo(params).then(res => {
                if (res.data.code == 1) {
                    let response = res.data.data
                    if (gopay == 1) {
                        let is_cansee = response.is_cansee
                        if (is_cansee == 2) {
                            this.cinfo = ''
                            this.showChp = true
                            this.ainfo.price = response.price
                            this.ainfo.id = id
                            this.ainfo.op = 2 //章节订单
                            return false
                        }

                        if (is_cansee == 3) {
                            this.showCol = true
                            return false
                        }
                    }

                    this.cinfo = response.info
                    // this.videoSrc = 'http://ztk.com/upload/admin/20250318/ff8fc209b13fb65c532225c18c3ea385.mp4'
                    // this.videoSrc = response.info.url
                    // this.videoType = response.info.op != 2 ? false : true
                    if (!this.videoType) {
                        this.$nextTick(() => {
                            this.$refs.htmlContainers.scrollTo({ top: 0 })
                        })
                    }

                }
            })
        },

        getArticleInfo(id) {
            let params = {
                id
            }
            this.$api.getArticleInfo(params).then(res => {
                if (res.data.code == 1) {
                    this.cinfo = res.data.data
                    this.videoType = false
                    let is_yf = this.col_id
                    if (!is_yf) {
                        this.id = res.data.data.col_id
                    }
                    this.is_art = true
                    this.getInfo()
                    this.getChapter()
                }
            })
        },

        getfocus() {
            this.cover = true

        },
        getblur() {
            this.cover = false
        },
        openReport(item) {
            this.form3.id = item.id
            this.reUname = item.user_nickname
            this.dialogVisible5 = true

        },

        onLike(id) {
            console.log(id);

        },

        // 评论举报
        onsubmit3() {
            this.form3.op = 3
            let params = this.form3

            this.$api.reportNow(params).then(res => {
                if (res.data.code == 1) {
                    this.$message({
                        message: '提交成功',
                        type: 'success'
                    })

                    this.form3.remark = ''
                    this.form3.reason = ''
                    this.dialogVisible5 = false

                }
            })

        },

        muluTry(item) {
            console.log('点击试读', item);

        },




        // async downloadFile(url, filename) {
        //     // window.open(url);

        //     try {
        //         // 使用 axios 获取文件
        //         const response = await axios.get(url, {
        //             responseType: 'blob', // 重要：指定响应类型为 blob
        //         });

        //         // 使用 FileSaver.js 保存文件
        //         saveAs(new Blob([response.data]), filename);
        //         this.$message({
        //             message: '文件下载成功',
        //             type: 'success'
        //         })
        //     } catch (error) {
        //         console.log(error);
        //         this.$message({
        //             message: '文件下载失败',
        //             type: 'error'
        //         })

        //     }
        // },

        // 选择支付方式
        openGrp() {
            this.showGrp = true
        },

        // 选择支付方式
        openCol() {
            let no_login = this.info.no_login
            if (no_login == 1) {
                this.$message({
                    message: '请先登录',
                    type: 'error'
                })
                return false;
            }

            this.showCol = true
        },

        // 选择支付方式
        openChp() {
            this.showChp = true
        },


        // 购买专栏
        buyNow(op) {
            this.ainfo.price = this.info.price
            this.ainfo.id = this.id
            this.ainfo.op = 1 //专栏订单
            let params = {
                id: this.id,
                is_bm: this.is_bm,
                bm_op: this.bm_op,
                bm_col: this.bm_col,
                bm_uid: this.bm_uid,
                pay_op: op
            }
            this.$api.payCol(params).then(res => {
                if (res.data.code == 1) {
                    this.showCol = false
                    if (op == 1) {
                        this.ainfo.img = baseUrl + 'home/base/qrcod?url=' + res.data.data.code_url;
                        this.query_col(res.data.data.id)
                        this.$refs.buyDia.open()
                    } else {
                        this.$message({
                            message: '购买成功',
                            type: 'success'
                        })
                        this.$refs.buyDia.close()
                        this.getInfo()
                        console.log('余额支付在这里')
                    }
                }
            })

        },


        query_grp(id) {
            // 3秒定时执行
            this.timer2 = setInterval(() => {
                let params = {
                    id
                }

                this.$api.queryGroups(params).then(res => {
                    if (res.data.code == 1) {
                        this.showPay = false
                        this.$message({
                            message: '购买成功',
                            type: 'success'
                        })
                        this.getInfo()
                        this.clearTimer()

                    }
                })
            }, 3000)
        },


        buyGrp(op) {
            let params = {
                id: this.info.groups.id,
                pay_op: op
            }
            this.$api.payGrp(params).then(res => {
                if (res.data.code == 1) {
                    this.showGrp = false
                    if (op == 1) {
                        this.showPay = true
                        this.pay_img = baseUrl + 'home/base/qrcod?url=' + res.data.data.code_url;
                        this.query_grp(res.data.data.id)
                    } else {
                        this.$message({
                            message: '购买成功',
                            type: 'success'
                        })
                        this.getInfo()

                    }
                }
            })
        },



        ClickMulu(id) {
            this.goPage('/columnRead', id)

            // this.cu_chpid = id

            // // 章节付费且没有购买记录不是试读
            // if (is_cansee != 1) {
            //     this.showChp = true
            //     this.ainfo.price = price
            //     this.ainfo.id = id
            //     this.ainfo.op = 2 //章节订单
            //     return false

            // }
            // this.getChapterInfo(id)

        },

        buyChp(op) {
            let params = {
                col_id: this.id,
                chp_id: this.cu_chpid,
                pay_op: op
            }
            this.$api.payChp(params).then(res => {
                if (res.data.code == 1) {
                    this.showChp = false
                    if (op == 1) {
                        this.ainfo.img = baseUrl + 'home/base/qrcod?url=' + res.data.data.code_url;
                        this.query_chp(res.data.data.id)
                        this.$refs.buyDia.open()
                    } else {
                        this.$message({
                            message: '购买成功',
                            type: 'success'
                        })
                        this.$refs.buyDia.close()
                        this.getInfo()
                    }
                }
            })
            return false
        },


        // 查询专栏支付
        query_col(id) {
            // 3秒定时执行
            this.timer = setInterval(() => {
                let params = {
                    id
                }

                this.$api.queryColumn(params).then(res => {
                    if (res.data.code == 1) {
                        this.$message({
                            message: '购买成功',
                            type: 'success'
                        })
                        this.$refs.buyDia.close()
                        this.getInfo()
                        this.clearTimer()
                    }
                })
            }, 3000)
        },

        // 查询章节支付
        query_chp(id) {
            // 3秒定时执行
            this.timer1 = setInterval(() => {
                let params = {
                    id
                }

                this.$api.queryChapter(params).then(res => {
                    if (res.data.code == 1) {
                        this.$message({
                            message: '购买成功',
                            type: 'success'
                        })
                        this.$refs.buyDia.close()
                        this.getInfo()
                        this.clearTimer()
                    }
                })
            }, 3000)
        },

        clearTimer() {
            if (this.timer) {
                clearInterval(this.timer)
                this.timer = null
            }

            if (this.timer1) {
                clearInterval(this.timer1)
                this.timer1 = null
            }

            if (this.timer2) {
                clearInterval(this.timer2)
                this.timer2 = null
            }

            if (this.timer3) {
                clearInterval(this.timer3)
                this.timer3 = null
            }
        },

        // 右侧目录触底
        load2() {
            console.log('目录触底');
            var page = this.pageNum2
            //如果请求未结束就返回不连续请求
            if (this.loading2) {
                return
            }
            //数据请求完成无更多数据时
            if (page >= this.totalPage2) {
                return false;
            }
            page = parseInt(page) + 1
            this.pageNum2 = page
            this.getChapter()
        },
        // 右侧评论触底
        load3() {
            console.log('评论触底');
            var page = this.pageNum3
            //如果请求未结束就返回不连续请求
            if (this.loading3) {
                return
            }
            //数据请求完成无更多数据时
            if (page >= this.totalPage3) {
                return false;
            }
            page = parseInt(page) + 1
            this.pageNum3 = page
            this.getComment()
        },
        // 右侧摘抄触底
        load4() {
            console.log('摘抄触底');
            var page = this.pageNum4
            //如果请求未结束就返回不连续请求
            if (this.loading4) {
                return
            }
            //数据请求完成无更多数据时
            if (page >= this.totalPage4) {
                return false;
            }
            page = parseInt(page) + 1
            this.pageNum4 = page
            this.getExcerpt()
        },
        // 右侧文库触底
        load5() {
            console.log('文库触底');

            var page = this.pageNum5
            //如果请求未结束就返回不连续请求
            if (this.loading5) {
                return
            }
            //数据请求完成无更多数据时
            if (page >= this.totalPage5) {
                return false;
            }
            page = parseInt(page) + 1
            this.pageNum5 = page
            this.getArticle()
        },
        // 右侧推荐触底
        load6() {
            console.log('推荐触底')
            var page = this.pageNum6
            //如果请求未结束就返回不连续请求
            if (this.loading6) {
                return
            }
            //数据请求完成无更多数据时
            if (page >= this.totalPage6) {
                return false;
            }
            page = parseInt(page) + 1
            this.pageNum6 = page
            this.getReco()
        },
        //  搜索
        load7() {
            console.log('搜索触底');

            var page = this.spageNum
            //如果请求未结束就返回不连续请求
            if (this.loading) {
                return
            }
            //数据请求完成无更多数据时
            if (page >= this.stotalPage) {
                return false;
            }
            page = parseInt(page) + 1
            this.spageNum = page
            this.searchCol()
        },
        // 文库评论列表
        load8() {
            console.log('文库评论触底');

            var page = this.apageNum
            //如果请求未结束就返回不连续请求
            if (this.aloading) {
                return
            }
            //数据请求完成无更多数据时
            if (page >= this.atotalPage) {
                return false;
            }
            page = parseInt(page) + 1
            this.apageNum = page
            this.getArtComment()
        },
        // 弹窗评论触底
        load() {
            var page = this.pageNum
            //如果请求未结束就返回不连续请求
            if (this.loading) {
                return
            }
            //数据请求完成无更多数据时
            if (page >= this.totalPage) {
                return false;
            }
            page = parseInt(page) + 1
            this.pageNum = page
            this.getParaList()
        },

        getComId(info) {
            let list = this.comlist
            let id = info.id
            let status = info.status
            let op = info.op


            list.forEach((i, d) => {
                if (id == i.id) {
                    if (op == 1) {
                        // 点赞评论
                        this.comlist[d].is_like = status
                        // 点赞
                        if (status == 1) {
                            this.comlist[d].likes += 1
                        } else {
                            this.comlist[d].likes -= 1
                        }
                    } else if (op == 3) {
                        this.comlist[d].shares += 1
                        let uname = this.comlist[d].user_nickname
                        let content = this.comlist[d].content
                        let title = uname + '的评论：'
                        this.openNow(title)

                    } else {
                        // 踩评论
                        this.comlist[d].is_dislike = status
                        // 点赞
                        if (status == 1) {
                            this.comlist[d].dislikes += 1
                        } else {
                            this.comlist[d].dislikes -= 1
                        }
                    }


                }
            })
        },



        getComId21(info) {
            let list = this.comlist
            let id = info.id
            let status = info.status
            let op = info.op


            list.forEach((i, d) => {
                if (id == i.id) {
                    if (op == 1) {
                        // 点赞评论
                        this.comlist[d].is_like = status
                        // 点赞
                        if (status == 1) {
                            this.comlist[d].likes += 1
                        } else {
                            this.comlist[d].likes -= 1
                        }
                    } else if (op == 3) {
                        this.comlist[d].shares += 1
                        let uname = this.comlist[d].user_nickname
                        let content = this.comlist[d].content
                        let title = uname + '的评论：'
                        this.openNow(title)

                    } else {
                        // 踩评论
                        this.comlist[d].is_dislike = status
                        // 点赞
                        if (status == 1) {
                            this.comlist[d].dislikes += 1
                        } else {
                            this.comlist[d].dislikes -= 1
                        }
                    }


                }
            })
        },

        getComId1(info) {
            const { id, status, op } = info;
            let updated = false;

            // 创建深拷贝以避免直接修改原始数据（Vue响应式需要）
            const updatedList = JSON.parse(JSON.stringify(this.comlist));

            // 递归查找并更新评论
            const updateComment = (comments) => {
                for (let i = 0; i < comments.length; i++) {
                    const comment = comments[i];

                    // 检查当前评论是否匹配
                    if (comment.id === id) {
                        console.log('commet是', comment.id)
                        console.log('得到的id是', id)
                        console.log('op是', op, status)
                        if (op === 1) {
                            // 点赞评论
                            comment.is_like = status;
                            comment.likes += status === 1 ? 1 : -1;
                        } else if (op === 3) {
                            // 分享
                            comment.shares += 1;
                            const title = `${comment.user_nickname}的评论：`;
                            this.openNow(title);
                        } else {
                            // 踩评论
                            comment.is_dislike = status;
                            comment.dislikes += status === 1 ? 1 : -1;
                        }
                        return true; // 找到并更新了评论
                    }

                    // 检查回复评论
                    if (comment.rep_list && comment.rep_list.length > 0) {
                        if (updateComment(comment.rep_list)) {
                            return true; // 在回复中找到并更新了评论
                        }
                    }
                }
                return false;
            };

            // 执行更新
            updateComment(updatedList);

            // 更新Vue数据（确保响应式）
            this.comlist = updatedList;
        },


        getExpId(info) {
            let list = this.excerpt
            let id = info.id
            let op = info.op
            let status = info.status

            list.forEach((i, d) => {
                if (id == i.id) {
                    if (op == 2) {
                        this.excerpt[d].is_like = status
                        // 点赞
                        if (status == 1) {
                            this.excerpt[d].likes += 1
                        } else {
                            this.excerpt[d].likes -= 1
                        }
                    } else {
                        console.log('摘抄id', id)
                        // 展开
                        this.excerpt[d].views += 1
                    }
                }
            })
        },


        // 切换tab
        changeTab2() {
            this.$refs.tab.changeTab(1)
        },
        changeTab(index) {
            console.log(index);
            this.currentTab = index
            // 目录
            if (index == 0) {
                this.chapter = []
                this.pageNum2 = 1
                this.getChapter()
            }

            // 评论
            if (index == 1) {
                // 聚焦输入评论
                // this.$nextTick(() => {
                //     this.$refs.comm.focus()
                // })
                this.comlist = []

                this.pageNum3 = 1
                this.getComment()
            }


            // 摘抄
            if (index == 2) {
                this.excerpt = []
                this.pageNum4 = 1
                this.getExcerpt()
            }

            // 文库
            if (index == 3) {
                this.article = []
                this.pageNum5 = 1
                this.getArticle()
            }

            // 推荐
            if (index == 4) {
                this.recolist = []
                this.pageNum6 = 1
                this.getReco()
            }


        },
        // 数据请求
        getParaList() {
            console.log(this.cu_chpid, '当前章节id对吗')
            this.loading = true
            let params = {
                page: this.pageNum,
                chose: this.selectedText,
                id: this.cu_chpid
            }
            this.$api.getParaList(params).then(res => {
                this.totalPage = res.data.data.last_page
                this.comList = this.comList.concat(res.data.data.data);
                this.loading = false
            })
        },
        goComm(item) {
            console.log(item, 1111);
            this.commuser = item
            this.$refs.comm.focus()
        },
        goOpen(id) {
            console.log(id);
        },
        handleSelectionChange() {
            const selection = window.getSelection();
            const selectedText = selection.toString().trim();
            if (selectedText === '') {
                this.showMenu = false
            }
        },

        // 获取选中文字
        getSelectedText(t) {
            if (t == 'zc') {
                this.tip = '摘抄'
            } else {
                this.tip = '评论'
            }
            const selection = window.getSelection();
            const selectedText = selection.toString().trim();
            this.selectedText = selectedText
            if (!this.is_art) {
                this.dialogVisible = true
                this.comList = []
                this.totalPage = 1
                this.pageNum = 1
                this.getParaList()
            }


        },

        closeDia() {
            this.dialogVisible = false
            if (window.getSelection) {
                window.getSelection().removeAllRanges();
            } else if (document.selection) {
                document.selection.empty(); // 兼容旧版 IE
            }
        },

        closeDiajb() {
            this.form2 = {
                reason: '',
                remark: ''
            };
            this.form3 = {
                reason: '',
                remark: ''
            }
        },

        // 鼠标左键松开时触发
        handleMouseUp(event) {
            const selection = window.getSelection();
            const selectedText = selection.toString().trim();
            if (selectedText !== '' && this.$refs.htmlContainer.contains(selection.anchorNode)) {
                // 显示菜单，并设置菜单位置
                this.showMenu = true;
                this.menuStyle = {
                    top: `${event.clientY}px`,
                    left: `${event.clientX}px`
                };
                // 存储选中的范围
                this.selectedRange = selection.getRangeAt(0);
            } else {
                this.showMenu = false;
            }
        },

    },
    beforeDestroy() {
        // 移除事件监听
        document.removeEventListener('selectionchange', this.handleSelectionChange);
    },
};
</script>

<style lang="scss" scoped>
/* 自定义菜单样式 */
.custom-menu {
    position: fixed;
    background-color: white;
    border: 1px solid #ccc;
    padding: 5px;
    z-index: 1000;
    border-radius: 10px;
    background-color: #1068E7;
}

.custom-menu button {
    display: block;
    width: 100%;
    padding: 5px 10px;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    color: #fff;
}

.custom-menu button:hover {
    color: #1068E7;
    background-color: #fff;
}

.main-con {
    border-top: 1px solid #D6D6D6;
    display: flex;
}

.media {
    width: 1080px;
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 119px);
    padding-right: 30px;
    position: relative;

    &::-webkit-scrollbar {
        width: 0;

    }

    >p {
        font-weight: 400;
        font-size: 20px;
        color: #FFFFFF;
        line-height: 48px;
        padding: 35px 0;

    }

    >video {
        width: 100%;
        height: 500px;
    }

    .setList {
        display: flex;
        margin-top: 30px;

        >div {
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 400;
            font-size: 14px;
            color: #666666;
            margin-right: 28px;

            i {
                margin-right: 6px;
            }
        }
    }
}

.article {
    .all {
        width: 1080px;
        // overflow-y: hidden;
        display: flex;
        flex-direction: column;
        height: calc(100vh - 100px);
        position: relative;
        overflow-y: auto;

        &::-webkit-scrollbar {
            width: 0;

        }

        margin-top: 30px;

        .bookImg {
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 120px;

            img {
                width: 100%;
                height: auto;
            }
        }

        .top {
            padding: 0 27px 19px;
            min-height: 211px;

            .title {
                padding: 37px 0 23px;
                font-weight: bold;
                font-size: 24px;
                color: #000000;


            }

            .author {
                font-weight: 400;
                font-size: 16px;
                color: #333333;

                >span {
                    display: inline-block;
                    margin-right: 30px;
                }
            }

            .other {
                margin-top: 15px;
                display: flex;
                align-items: center;
                font-size: 16px;
                color: #333333;

                .price {
                    font-weight: 400;
                    font-size: 16px;
                    color: #333333;
                    display: flex;
                    align-items: center;

                    span {
                        margin-right: 15px;
                        font-size: 16px;
                        color: #333333;

                    }
                }

                .cod {
                    font-size: 16px;
                    color: #333333;
                    cursor: pointer;
                    flex: 1;
                    display: flex;
                    justify-content: flex-end;

                    >span {
                        margin-left: 8px;
                        border-right: 1px solid #000;
                        padding-right: 8px;

                        &:last-child {
                            border: none;
                            padding-right: 0;
                        }

                        &:first-child {
                            margin-left: 0;
                        }
                    }
                }
            }

            .tron {
                font-size: 20px;
                color: #000000;
                margin-top: 30px;
            }
        }


        .vhtml {
            margin-top: 27px;
            width: 1080px;
            -ms-overflow-style: none;

            &::-webkit-scrollbar {
                width: 0;

            }

            .richText {
                width: 1080px;
                padding-right: 120px;
                padding-bottom: 40px;
                font-weight: 400;
                font-size: 22px;
                color: #000000;
                line-height: 60px;

                ::v-deep span,
                div,
                p {
                    font-family: Microsoft YaHei;
                    font-weight: 400;
                    font-size: 22px;
                    color: #000000;
                    line-height: 40px;
                }

                ::v-deep .num {
                    width: 20px;
                    height: 20px;
                    display: inline-flex;
                    justify-content: center;
                    text-align: center;
                    color: #FF0000;
                    align-items: center;
                    border: 1px solid #FF0000;
                    border-radius: 50%;
                    box-sizing: content-box;
                    font-size: 16px;
                    user-select: none;
                    /* 标准语法 */
                    -webkit-user-select: none;
                    /* Safari */
                    -moz-user-select: none;
                    /* Firefox */
                    -ms-user-select: none;
                    /* IE/Edge */
                }
            }

            .setList {
                position: absolute;
                bottom: 22px;
                right: 70px;
                z-index: 8;

                >div {
                    display: flex;
                    flex-direction: column;
                    align-items: center;
                    justify-content: center;
                    font-weight: 400;
                    font-size: 14px;
                    color: #666666;
                    margin-bottom: 10px;

                    i {
                        margin-bottom: 2px;
                        font-size: 25px;
                    }
                }
            }
        }
    }

    .pinglun {
        padding-right: 120px;
        width: 1080px;
        position: relative;
        margin-top: 20px;

        >p {
            padding: 0 0 10px;
            font-weight: bold;
            font-size: 20px;
            color: rgb(16, 104, 231);
        }

        .ptabs {
            max-height: 600px;
            overflow-y: auto;
            -ms-overflow-style: none;
            padding-bottom: 20px;
            min-height: 0px;

            &::-webkit-scrollbar {
                width: 0;
            }



        }

        .pushPl {
            display: flex;
            align-items: center;
            background-color: #fff;
            // position: absolute;
            width: 100%;
            padding: 30px 0;
            left: 0;
            position: relative;

            .append {
                position: absolute;
                right: 0px;
                top: 30px;
                width: 80px;
                height: 40px;
                line-height: 40px;
                text-align: center;
                cursor: pointer;
                font-size: 16px;
                background-color: #1068E7;
                border-radius: 5px;
                color: #fff;
            }

            .callback {
                width: 100%;
                position: absolute;
                top: 0;
                height: 30px;
                line-height: 30px;
                display: flex;
                color: #a39f9f;
                font-size: 16px;
                justify-content: space-between;
                align-items: center;

                >span {
                    cursor: pointer;
                    display: inline-block;
                    padding-right: 25px;
                    color: #f35c5c;
                }
            }

            ::v-deep input {
                padding-right: 100px;
            }
        }
    }
}

.dialog-header {
    font-weight: bold;
    font-size: 22px;
}

.dialog-footer {
    font-weight: bold;
    font-size: 22px;
    display: flex;
    justify-content: center;
    align-items: center;

    button {
        margin: 0 50px;
    }
}

.pop {
    padding: 0 30px;

    ::v-deep .el-form-item {
        margin-bottom: 0 !important;
    }
}

.dialog-footer {
    button {
        width: 140px;
        height: 50px;
        font-size: 16px;
        line-height: 50px;
        padding: 0;
    }
}

.dialog-footer2 {
    display: flex;
    justify-content: center;

    button {
        width: 90px;
        height: 40px;
        font-size: 15px;
        line-height: 40px;
        padding: 0;
    }
}

.comment {
    margin-top: 20px;

    >p {
        font-weight: 600;
        font-size: 18px;
        color: #000000;
    }

    .listCom {
        height: 300px;
        width: 100%;
        overflow-y: auto;
        -ms-overflow-style: none;
        border: 1px solid #D6D6D6;
        margin-top: 15px;
        border-radius: 10px;
        padding: 10px 30px;

        &::-webkit-scrollbar {
            width: 2px;
        }
    }
}

.tabList {
    flex: 1;
    height: calc(100vh - 119px);
    width: 520px;

    .top {
        padding: 0 27px 19px;
        border-bottom: 2px solid #1068E7;
        min-height: 211px;
        background: #FFFFFF;

        .title {
            padding: 37px 0 23px;
            font-weight: bold;
            font-size: 36px;
            color: #1068E7;


        }

        .author {
            font-weight: 400;
            font-size: 16px;
            color: #333333;

            >span {
                display: inline-block;
                margin-right: 30px;
            }
        }

        .other {
            margin-top: 24px;
            display: flex;
            justify-content: space-between;
            align-items: center;

            .price {
                font-weight: 400;
                font-size: 16px;
                color: #333333;
                display: flex;
                align-items: center;

                .num {
                    font-size: 28px;
                    margin-right: 10px;
                }


                .num1 {
                    font-size: 20px;
                    color: #a39f9f;
                    text-decoration: line-through;
                }

                .btn {
                    color: #333333;
                    cursor: pointer;
                    display: inline-block;
                    width: 60px;
                    height: 30px;
                    text-align: center;
                    line-height: 30px;
                    background-color: #F9C541;
                    margin-left: 22px;
                }
            }

            .cod {
                font-size: 16px;
                color: #333333;
                cursor: pointer;
                flex: 1;
                display: flex;
                justify-content: flex-end;

                >span {
                    margin-left: 8px;
                    border-right: 1px solid #000;
                    padding-right: 8px;

                    &:last-child {
                        border: none;
                        padding-right: 0;
                    }

                    &:first-child {
                        margin-left: 0;
                    }
                }
            }
        }


    }

    .ptuan {
        background-color: #1068E7;
        color: #fff;
        padding: 10px 60px 15px 27px;

        >div {
            display: flex;
            align-items: center;
        }

        .priceT {
            margin-bottom: 10px;


            >div {
                color: #F9C541;

                >span {
                    &:first-child {
                        font-size: 16px;
                        margin-bottom: 2px;
                    }

                    font-size: 30px;
                }
            }
        }

        .timeT {
            justify-content: space-between;
        }
    }

    .classify {
        padding-right: 30px;

        .ltab {
            display: flex;
            align-items: center;
            height: 111px;
            position: relative;
            padding-left: 10px;

            >img {
                width: 22px;
                height: 22px;

            }

            .search {
                padding: 30px 0;
                box-sizing: content-box;
                position: relative;
                width: 160px;
                height: 45px;
                display: flex;
                align-items: center;

                // animation: reduceWidth .3s forwards;
                img {
                    width: 22px;
                    height: 22px;
                    cursor: pointer;
                    position: absolute;
                    top: calc(50% - 11px);
                    right: 1.2rem;
                }

                input {
                    width: 100%;
                    height: 100%;
                    outline: none;
                    background: #F6F6F6;
                    border-radius: 1.25rem;
                    padding: 0 3rem 0 1.2rem;
                    box-sizing: border-box;
                    font-size: 0.83rem;
                    border: none;
                    border: 1px solid #F6F6F6;

                    &:focus {
                        border: 1px solid #1068E7;
                    }
                }

                .pla {
                    font-weight: 400;
                    font-size: 0.83rem;
                    color: #666666;
                }
            }

            .cover {
                width: calc(100% - 20px);
                position: absolute;
                right: 0;
                top: 3px;
                background-color: #fff;
                animation: expandWidth .3s forwards;
            }

            @keyframes reduceWidth {
                0% {
                    width: calc(100% - 20px);
                }

                100% {
                    width: 160px;
                }
            }

            @keyframes expandWidth {
                0% {
                    width: 160px;
                }

                100% {
                    width: calc(100% - 20px);
                }
            }

        }
    }

    .classList {
        position: relative;

        .mulu {
            height: calc(100vh - 290px);
            overflow-y: auto;
            -ms-overflow-style: none;
            padding: 0 30px;
            min-height: 300px;
            overflow-x: hidden;

            &::-webkit-scrollbar {
                width: 0;
            }

            >div {
                margin-bottom: 30px;
                font-weight: 400;
                font-size: 20px;
                color: #333333;
                position: relative;
                cursor: pointer;

                .line1 {
                    padding-right: 20px;

                    &:hover {
                        color: #1068E7;
                    }
                }

                .active {
                    color: #1068E7;
                }

                .videoType {
                    color: #fff;

                    &:hover {
                        color: #66CCFF;
                    }
                }

                .try {
                    position: absolute;
                    right: -40px;
                    top: 0;
                    color: #1068E7;
                }
            }
        }

        .pinglun {
            padding-left: 30px;

            >p {
                padding: 0 0 30px;
                font-weight: bold;
                font-size: 20px;
                color: #000000;
            }

            .ptabs {
                height: calc(100vh - 346px);
                overflow-y: auto;
                -ms-overflow-style: none;
                padding-bottom: 104px;
                min-height: 300px;

                &::-webkit-scrollbar {
                    width: 0;
                }



            }

            .pushPl {
                display: flex;
                align-items: center;
                background-color: #fff;
                position: absolute;
                bottom: 0px;
                width: 100%;
                padding: 30px 0;

                .append {
                    position: absolute;
                    right: 0px;
                    top: 30px;
                    width: 80px;
                    height: 40px;
                    line-height: 40px;
                    text-align: center;
                    cursor: pointer;
                    background-color: #1068E7;
                    border-radius: 5px;
                    color: #fff;
                    font-size: 16px;
                }

                .callback {
                    width: 100%;
                    position: absolute;
                    top: 0;
                    height: 30px;
                    line-height: 30px;
                    display: flex;
                    color: #a39f9f;
                    font-size: 16px;
                    justify-content: space-between;
                    align-items: center;

                    >span {
                        cursor: pointer;
                        display: inline-block;
                        padding-right: 25px;
                        color: #f35c5c;
                    }
                }

                ::v-deep input {
                    padding-right: 100px;
                }
            }
        }

        .sousuo {
            padding-left: 30px;

            .sstop {
                padding: 0 0 30px;
                display: flex;
                justify-content: space-between;
                align-items: center;

                >p {
                    font-weight: bold;
                    font-size: 20px;
                    color: #000000;
                }
            }


            .ptabs {
                height: calc(100vh - 290px);
                overflow-y: auto;
                -ms-overflow-style: none;
                padding-bottom: 104px;
                min-height: 300px;
                width: 100%;

                &::-webkit-scrollbar {
                    width: 0;
                }

                >div {
                    margin-bottom: 30px;
                    font-weight: 400;
                    font-size: 20px;
                    color: #333333;
                    position: relative;
                    cursor: pointer;
                    width: 100%;

                    .line1 {
                        padding-right: 20px;

                        &:hover {
                            color: #1068E7;
                        }
                    }

                    .videoType {
                        color: #fff;

                        &:hover {
                            color: #66CCFF;
                        }
                    }

                    .try {
                        position: absolute;
                        right: -40px;
                        top: 0;
                        color: #1068E7;
                    }
                }
            }

        }

        .zhaichao {
            height: calc(100vh - 290px);
            overflow-y: auto;
            -ms-overflow-style: none;
            padding: 0 0 0 20px;
            min-height: 300px;

            &::-webkit-scrollbar {
                width: 0;
            }


        }

        .wenku {
            height: calc(100vh - 290px);
            overflow-y: auto;
            -ms-overflow-style: none;
            padding: 0 30px;
            min-height: 300px;

            &::-webkit-scrollbar {
                width: 0;
            }

            .articku {
                margin-bottom: 30px;
                font-weight: 400;
                font-size: 20px;
                color: #333333;
                position: relative;
                cursor: pointer;
                border-bottom: 1px solid #C8CED6;
                padding-bottom: 22px;
                display: flex;
                align-items: center;

                .type {
                    width: 16px;
                    height: auto;
                    margin-right: 16px;
                    flex-shrink: 0;
                }

                a {
                    color: #333333;
                    text-decoration: none;
                }

                .line1 {
                    padding-right: 20px;

                    &:hover {
                        color: #1068E7;
                    }
                }

                .videoType {
                    color: #fff;

                    &:hover {
                        color: #66CCFF;
                    }
                }

                .try {
                    position: absolute;
                    right: -40px;
                    top: 0;
                    color: #1068E7;
                }
            }
        }

        .tuijian {
            height: calc(100vh - 290px);
            overflow-y: auto;
            -ms-overflow-style: none;
            padding: 0 0 0 20px;
            min-height: 300px;

            &::-webkit-scrollbar {
                width: 0;
            }

            .list_box {
                cursor: pointer;
                display: flex;
                align-items: center;
                margin-bottom: 1.04rem;
                padding: 1.04rem 1.6rem 0.94rem 0.99rem;
                border: none !important;

                >img {
                    width: 4.17rem;
                    height: 4.17rem;
                    border-radius: 10px;
                    flex-shrink: 0;
                }

                .list_t {
                    flex: 1;

                    margin-left: 0.99rem;
                    display: flex;
                    justify-content: space-between;
                    flex-direction: column;
                    height: 4.87rem;

                    >span {
                        font-weight: 400;
                        font-size: 18px;
                        color: #333333;
                    }

                    >div {
                        display: flex;
                        align-items: center;
                        justify-content: space-between;

                        >span {
                            font-weight: 400;
                            font-size: 16px;
                            color: #666666;
                        }

                        >div {
                            margin-top: 20px;
                            font-weight: 400;
                            font-size: 15px;
                            color: #666666;

                            img {
                                width: 18px;
                                height: 14px;
                                margin-right: 0.1rem;
                            }

                            span {
                                display: inline-block;
                                min-width: 35px;
                                text-align: right;
                            }
                        }
                    }
                }

                .list_t2 {
                    margin-left: 0.99rem;
                    display: flex;
                    justify-content: space-between;
                    flex-direction: column;
                    height: 100%;
                    width: 14.27rem;

                    .name {
                        display: flex;
                        align-items: center;
                        font-weight: 400;
                        font-size: 1.15rem;
                        color: #333333;

                        img {
                            width: 1.25rem;
                            height: 1.25rem;
                            margin-left: 0.7rem;
                            flex-shrink: 0;
                        }
                    }

                    .vip {
                        color: #1068E7;
                    }

                    .sign {
                        width: 100%;
                        font-weight: 400;
                        font-size: 1.04rem;
                        color: #666666;
                    }

                    .hot {
                        display: flex;
                        align-items: center;
                        margin-top: 0.5rem;

                        div {
                            display: flex;
                            align-items: center;
                            font-weight: 400;
                            font-size: 0.94rem;
                            color: #999999;
                            margin-right: 1.6rem;

                            img {
                                width: 1.2rem;
                                height: 1.09rem;
                            }

                            &:nth-child(2) {
                                img {
                                    width: 0.99rem;
                                    height: 0.99rem;
                                }
                            }
                        }
                    }
                }
            }
        }
    }

}

.swiper-containers {
    width: 100%;
    height: 230px;
    position: relative;
    display: flex;
    align-items: center;
    background-color: #f0f0f0;

    .giftsilder {
        border: 1px solid #f0f0f0;
        width: 150px;
        height: 230px;
        border-radius: 6px;
        border: 1px solid #f0f0f0;
        cursor: pointer;
        margin-bottom: 10px;
        display: flex;
        flex-direction: column;
        align-items: center;

        &:hover {
            background: #fff;
            border-color: #ec782d;
        }

        .name {
            font-size: 18px;
            color: #3f3a39;
            margin: 5px 0;
        }

        .price {
            display: block;
            font-size: 18px;
            color: #1068E7;
        }

        .img {
            width: 100%;
            height: 150px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;

            img {
                width: 80px;
                max-width: 100%;
                max-height: 100%;
                object-fit: cover;
            }
        }
    }

    .active {
        background: #fff;
        border-color: #ec782d;
    }

    ::v-deep .swiper-container {
        width: 100%;
        height: 100%;

        .swiper-button-prev {
            left: 10px;

            i {
                font-size: 30px;
                color: #ec782d;
            }

        }

        .swiper-button-prev:after {
            content: '';
        }

        .swiper-button-next:after {
            content: '';
        }

        .swiper-button-next {
            right: 10px;

            i {
                font-size: 30px;
                color: #ec782d;
            }
        }
    }



    .sildTitle {
        position: absolute;
        z-index: 8;
        bottom: 1.41rem;
        padding: 0 2.55rem;
        box-sizing: border-box;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;

        div {
            width: 11.46rem;
            cursor: pointer;
            height: 4.17rem;
            background: rgba($color: #000000, $alpha: .5);
            border-radius: 0.42rem;
            font-family: Microsoft YaHei;
            font-weight: bold;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.46rem;
            color: #FFFFFF;
            line-height: 1.25rem;
        }
    }
}

.nums {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 60px;

    ::v-deep .el-input-number__decrease,
    ::v-deep .el-input-number__increase {
        background-color: transparent;
    }

    .mynum {
        width: 150px;
        position: relative;

        >div {
            display: inline-flex;
            flex-direction: column;
            align-items: center;
            font-size: 14px;
            color: #999999;

            >span {
                &:first-child {
                    flex: 1;
                    font-size: 20px;
                    color: #d41f19;
                    margin-bottom: 5px;

                }
            }
        }

        >span {
            cursor: pointer;
            position: absolute;
            bottom: 0;
            right: -15px;
            font-size: 14px;
            color: #d41f19;
            position: absolute;
        }
    }
}

.blackSty {
    background: rgb(0, 0, 0);
    overflow-y: auto;

    &::-webkit-scrollbar {
        width: 0;
    }
}

@media screen and (max-width:768px) {
    .main-con {
        width: 100vw;
        padding: 0 10px;

        .article {
            width: 100%;

            .all {
                width: 100%;
                overflow: visible;
.top{
    
    .other {
                margin-top: 10px;
                font-size: 12px;
                .price {
                    font-size: 12px;

                    span {
                        font-size: 12px;
                    }

                    .num {
                        font-size: 13px;
                        margin-right: 15px;
                    }

                    .num1 {
                        font-size: 13px;
                    }
                }

                .cod {
                    font-size: 13px;

                    >span {
                        padding-right: 10px;
                        margin-left: 10px;
                    }
                }
            }
}
                .bookImg {
                    width: 100%;
                }

                .top {
                    .title {
                        font-size: 20px;
                        padding: 10px 0;
                    }

                    .author {
                        font-size: 13px;

                        >span {
                            margin-right: 10px;
                        }
                    }

                    .tron {
                        font-size: 14px;
                        margin-top: 20px;
                        letter-spacing: 2px;
                        line-height: 20px;
                    }
                }
            }
        }

    }

    .mul {
        position: fixed;
        right: 10px;
        top: 130px;
        z-index: 222;

        img {
            width: 20px;
            height: 20px;

        }

        border-radius: 10px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        font-size: 10px;
        color: #fff;
        padding: 10px;
        background-color: rgba($color: #000000, $alpha: .5);
    }

    .tabList {
        width: 100%;
        height: calc(100vh - 40px);

        .top {
            height: 101px;

            top: 0;
            padding: 0 10px 10px;

            .title {
                font-size: 20px;
                padding: 0 0 20px;
            }

            .author {
                font-size: 13px;

                >span {
                    margin-right: 10px;
                }
            }

            .other {
                margin-top: 10px;
                font-size: 12px;
                .price {
                    font-size: 12px;

                    span {
                        font-size: 12px;
                    }

                    .num {
                        font-size: 13px;
                        margin-right: 15px;
                    }

                    .num1 {
                        font-size: 13px;
                    }
                }

                .cod {
                    font-size: 13px;

                    
                }
            }
        }

        .classify {
            padding: 0 10px;

            .ltab {
                height: 50px;
                padding-right: 0;

                >img {
                    width: 14px;
                    height: 14px;
                    margin-bottom: 15px;
                }

                .search {
                    width: 100% !important;
                    height: 40px;

                    input {
                        border-radius: 10px;
                        font-size: 14px;
                    }

                    img {
                        width: 14px;
                        height: 14px;
                        top: calc(50% - 7px);
                    }
                }

                .cover {
                    left: 0;
                }
            }

            .sousuo {
                .sstop {
                    >p {
                        font-size: 13px;
                    }

                    button {
                        font-size: 12px;
                    }
                }

                .ptabs {
                    height: calc(100vh - 250px);

                    >div {
                        font-size: 13px;
                    }
                }
            }

            .mulu {
                height: calc(100vh - 200px);

                >div {

                    font-size: 15px;
                }
            }

            .pinglun {
                .ptabs {
                    height: calc(100vh - 200px);

                }

                >p {
                    font-size: 13px;
                }

                .pushPl {
                    display: flex;
                    align-items: center;
                    height: 70px;

                    .callback {
                        font-size: 12px;
                    }

                    .el-input {
                        width: calc(100% - 60px);
                    }

                    .append {
                        height: 27px;
                        font-size: 12px;
                        width: 60px;
                        line-height: 27px;
                        position: static;
                    }
                }
            }

            .zhaichao {
                height: calc(100vh - 200px);
            }

            .wenku {
                height: calc(100vh - 200px);

                .articku {
                    margin-bottom: 15px;
                    padding-bottom: 10px;
                    font-size: 13px;

                    .type {
                        width: 13px;
                        margin-right: 10px;
                    }
                }
            }

            .tuijian {
                height: calc(100vh - 200px);
               .list_box {
                margin-bottom: 10px;
                > img{
                width: 60px;
                height: 60px;
                border-radius: 10px;
              }
                .list_t{
                    margin-left: 10px;
                    font-size: 13px;
                    height: auto;
                    >span{
                        font-size: 13px;
                        margin-bottom: 5px;
                    }
                    >div{
                    >span{
                        font-size: 12px;
                    }
                    >div{
                        font-size: 12px;
                        img{
                            width: 13px;
                            height: 10px;
                            margin-right: 5px;
                        }
                    }
                }
                }
               
               }
            }
        }
    }

}
</style>
